//公钥
window._publicKeyString = 'MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQCsZDyZNj4PaR+lgIy45ZFO5xDXEIf+xsucJ9Hj/Mu87vJ7+OI/QJPmJwPMHWyRfycIsikvHVjuwh+6sFWsZlSFmaGzFK7BIephryj4/j+ZcX45f2KvraHAOB5XuwfwkjgmlOclr55K1dhNl8bSbuL2estMV7IpIKoic157G3A4IQIDAQAB';
/**
 * 加密
 * @param _pwd 页面密码
 * @return {string}
 * @private
 */
window._encryPwd = function (_pwd) {
    var encrypt = new JSEncrypt();
    encrypt.setPublicKey(_publicKeyString);
    var d=encrypt.encrypt(_pwd);
    var newPwd = encodeURI(d).replace(/\+/g, '%2B');
    return newPwd;
}
window._getHost = function(){
    var _protocol = window.location.protocol;//得到的是https:不是https
    if (window.location.protocol=='https' || _protocol == 'https:'){
        return "https://"+window.location.host+'';
    }else{
        return "http://"+window.location.host+'';
    }
}
